package cn.vortex.device.tool;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * @author vortex
 * @create 2020-09-08 16:50
 */
public class GetDatetime {
    public static String getDatetime(){
        LocalDateTime localDateTime = LocalDateTime.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        //格式化
        String str = formatter.format(localDateTime);
        return str;
    }


}
